package org.smallreunion.controller;

import org.slim3.controller.router.RouterImpl;
import org.slim3.util.RequestUtil;

public class AppRouter extends RouterImpl {

    public AppRouter() {
        addRouting("/bbs/feed/{feedType}", "/bbs/feed?feedType={feedType}");

        addRouting("/ajax/bbs\\.{extension}", "/ajax/bbs/get{extension}");
    }

    @Override
    public boolean isStatic(String path) throws NullPointerException {
        boolean isStatic = super.isStatic(path);

        if("json".equals(RequestUtil.getExtension(path)) || "txt".equals(RequestUtil.getExtension(path))) {
            return false;
        } else {
            return isStatic;
        }
    }

}
